package Book;

import java.util.Arrays;

/**
 * @Author YuanYuan
 * @Date 2022/5/18
 * @Time 10:20
 */
public class BookList {


    private Book[] books = new Book[10];
    private int number ;

    public BookList() {
        books[0] = new Book("活着","余华",19.9);
        books[1] = new Book("红楼梦","曹雪芹",29.3);
        books[2] = new Book("哑舍","玄色",35.2);

        number = 3;
    }


    public Book getBooks(int pos) {
        return books[pos];
    }

    public void setBooks(int pos,Book book) {
        books[pos] = book;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    @Override
    public String toString() {
        return "BookList{" +
                "books=" + Arrays.toString(books) +
                '}';
    }
}
